<template>
  <div class="page-container">
    <cm-table
      :filters="filters"
      :filterFields="filterFields"
      :columns="columns"
    ></cm-table>
  </div>
</template>

<script setup>
import {ref} from 'vue';
import date from "@/utils/date";

const filters = ref({
  code: ''
});
// 分页查询条件
const filterFields = ref([
  {prop: "memberName", label: "会员名称"},
  {prop: "code", label: "证券代码"},
  {prop: "startDate", label: "开始时间", type: 'date'},
  {prop: "endDate", label: "结束时间", type: 'date'},
]);
const columns = ref([
  {prop: "memberName", label: "会员名称", minWidth: 100},
  {prop: "accountId", label: "资金账户", minWidth: 100},
  {prop: "tradedTime", label: "成交时间", minWidth: 150, formatter: (prop, value, row) => {
      return row.tradedTime ? date.simpleDateFormat(row.tradedTime * 1000, 'yyyy-MM-dd HH:mm:ss') : ''
    }
  },
  {prop: "code", label: "证券代码", minWidth: 100},
  {prop: "name", label: "证券名称", minWidth: 100},
  {prop: "orderType", label: "买卖标记", minWidth: 100, type: 'dic-value', dicCode: 'dicOrderType'},
  {prop: "tradedPrice", label: "成交价格", minWidth: 100, type: 'number', point: 2, align: 'right'},
  {prop: "tradedVolume", label: "成交数量", minWidth: 100, type: 'number', align: 'right'},
  {prop: "tradedAmount", label: "成交金额", minWidth: 100, type: 'number', point: 2, align: 'right'},
  {prop: "commission", label: "手续费", minWidth: 100, type: 'number', point: 2, align: 'right'},
  {prop: "profitMoney", label: "平仓盈亏", minWidth: 100, type: 'number', point: 2, align: 'right'},
  {prop: "orderSysId", label: "合同编号", minWidth: 100},
  {prop: "createTime", label: "创建时间", width: 160},
]);
</script>